<extend name="template/base_index" />


<block name="area_header">
    <link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
    <!--<link type="text/css" rel="stylesheet" href="__CDN__/amazeui/2.3.0/css/amazeui.min.css" />-->
    <script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="__CSS__/zjqnew.css">
</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <div class="filter-controls">
                <style type="text/css">
                    .modal .modal-backdrop {
                        z-index: 1 !important;
                    }
                    .modal .modal-dialog {
                        z-index:999;
                    }
                </style>
                <!-- 日期查询 -->
                <form action="{:U('ApplyMoney/index')}" method="post" class="form-inline">
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon">
                                微信号名称
                                <i class="fa fa-calendar"></i>
                            </div>
                            <input type="text" name="nickname" id="enddatetime" class="form-control input-short" value="{$nickname}">
                        </div>
                    </div>
                    <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>查找</button>
                </form>
            </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th><th>提现用户微信名称</th><th>提现金额</th><th>提现申请时间</th><th>提现支付宝账户</th><th>账户人姓名</th><th>审核状态</th><th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="list" id="list">
                    <tr>
                        <td>{$list['id']}</td><td>{$list['nickname']}</td><td>￥{$list['money']}</td><td>{$list['create_time']}</td><td>{$list['cash_account']}</td><td>{$list['account_name']}</td>
                        <td>
                            <eq name="list['status']" value = "0">
                                <span>待审核</span>
                            </eq>
                            <eq name="list['status']" value = "1">
                                <span>审核通过</span>
                            </eq>
                            <eq name="list['status']" value="2">
                                <span>审核不通过</span>
                            </eq>
                        </td>
                        <td>
                            <eq name="list['status']" value="0">
                                <button type="button" class="btn btn-warning fail-reviewed" data-value="{:U('ApplyMoney/ajax_reviewed',array('id' =>$list['id'],'openid'=>$list['openid']))}" data-toggle="modal" data-target=".bs-example-modal-lg">审核不通过</button>
                                <button type="button" class="btn btn-danger success-reviewed" data-value="{:U('ApplyMoney/ajax_reviewed',array('id' =>$list['id'],'openid'=>$list['openid']))}" data-toggle="modal" data-target="#successModal">审核通过</button>
                            </eq>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </table>
        </div>
        <center>{$show}</center>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->

    <script>
        $(function(){
            $('.fail-reviewed').bind("click",function(){
                $('#failurl').val($(this).attr('data-value'));
            });
            $('.success-reviewed').bind("click",function(){
                $('#successurl').val($(this).attr('data-value'));
            });
        });
        /*
         * 失败ajax数据上传
         * */
        function send_reviewed(){
            var url = $('#failurl').val();
            var reason = $('[name="reason"]').val();
            $.get(url,{reason:reason,true_false:"2"},function(msg){
                $('.bs-example-modal-lg').modal('hide');
                $('#failurl').val('');
                if(msg){
                    window.location.reload();
                }
            })
        }
        /*
         * 成功ajax数据上传
         * */
        function send_reviewed_s(){
            var url = $('#successurl').val();
            var reason = $('[name="reason"]').val();
            $.get(url,{true_false:"1"},function(msg){
                $('#successModal').modal('hide');
                $('#successurl').val('');
                if(msg){
                    window.location.reload();
                }
            })
        }
    </script>
    <!-- 审核失败模态弹窗 -->
    <!-- Large modal -->

    <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" style="display: none;">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">

                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel">审核失败的原因</h4>
                </div>
                <div class="modal-body">
                    <textarea class="form-control" rows="3" name="reason"></textarea>
                    <input type="hidden" value=""  id="failurl">
                    <center><button class="btn btn-danger m-cancel" data-dismiss="modal">取消</button><button class="btn btn-warning m-ensure" onclick="send_reviewed()">确定</button></center>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>

    <!--审核成功模态弹窗-->
    <!-- Modal -->
    <div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">提示</h4>
                </div>
                <div class="modal-body">
                    确定要将该用户的审核通过 大兄弟长点心那可是钱 ：)
                    <input type="hidden" id="successurl" value="" >
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" onclick="send_reviewed_s()">确定</button>
                </div>
            </div>
        </div>
    </div>

</block>

<block name="area_footer">

</block>